﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Krile.Kernel.Plugin.Operations.AgentElements
{
    //UID: krile Universal IDentification number.
    public interface IStatusControl
    {
        /// <summary>
        /// Receive global timeline
        /// </summary>
        bool RecvGlobalTimeline { get; set; }

        /// <summary>
        /// Receive statuses
        /// </summary>
        void ReceiveStatuses();

        /// <summary>
        /// can update now
        /// </summary>
        bool Updatable { get; }

        /// <summary>
        /// Update status
        /// </summary>
        /// <param name="text">update text</param>
        /// <param name="replyto">replyto uid</param>
        /// <param name="affixObject">common affix object</param>
        /// <returns>retult of operation</returns>
        OperationResult<object> Update(string text, ulong replyto, object affixObject);

        /// <summary>
        /// can destroy now (if you set false, overrides all another value)
        /// </summary>
        bool Destroiable { get; }

        /// <summary>
        /// If this property true, Krile will make a cmdbtn/context menu for fav oper automatically.
        /// </summary>
        bool AutoCreateFavOperationTriggers { get; }

        /// <summary>
        /// If this property true, Krile will make a cmdbtn/context menu for reply oper automatically.
        /// </summary>
        bool AutoCreateReplyOperationTriggers { get; }

        /// <summary>
        /// If this property true, Krile will make a cmdbtn/context menu for del oper automatically.
        /// </summary>
        bool AutoCreateDeleteOperationTriggers { get; }

        /// <summary>
        /// Destroy status
        /// </summary>
        /// <param name="uid">remove status uid</param>
        /// <returns>result of operation</returns>
        OperationResult<object> Destroy(ulong uid);

        /// <summary>
        /// Set favorite state
        /// </summary>
        /// <param name="uid">target uid</param>
        /// <param name="create">true:create favorite false:destroy favorite</param>
        /// <returns>result for operation</returns>
        OperationResult<object> SetFavorite(ulong uid, bool create);

        /// <summary>
        /// Get universal status id from service status id
        /// </summary>
        /// <param name="id">service status id</param>
        /// <returns>univ id</returns>
        ulong GetUidFromServiceStatusId(string id);

        /// <summary>
        /// Check service status id exists
        /// </summary>
        /// <param name="id">check service status id</param>
        /// <returns>if exists, return true</returns>
        bool ServiceStatusIdExists(string id);
    }
}
